#ifndef db_PAGINATION_H
#define db_PAGINATION_H

namespace serika
{
	namespace db
	{
		template<typename TYPE>
		class Pagination
		{
		public:
	
			Pagination()
			{
				mCurrentPage = mPageCount = 0;
			}
	
			~Pagination()
			{
				for (typename std::vector<TYPE*>::iterator itr = mResultSet.begin(); itr != mResultSet.end(); ++itr)
				{
					delete (*itr);
				}
				mResultSet.clear();
			}
	
			int GetPageCount() const { return mPageCount; }
			int GetCurrentPage() const { return mCurrentPage; }
			int GetPrevious() const { return mCurrentPage - 1; }
			int GetNext() const { return mCurrentPage + 1; }
	
			std::vector<TYPE*>& GetResults() { return mResultSet; }
	
		private:
			std::vector<TYPE*> mResultSet;
			int mCurrentPage;
			int mPageCount;
	
			friend class RecordBase;
		};
	}
}

#endif
